{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>账户余额</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<span><em class="uk-text-danger">{$uinfo['amount']}</em>元</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<form id="formid">
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>提现类型</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="mui-pull-left uk-margin-xsmall-right">
							<img src="{$images_path}tm-pay-icon-yl.png" width="24" height="24" />
						</div>
						<div class="mui-media-body" style="margin-top: 5px;">
							<div>银行卡</div>
						</div>
						<input name="paytype" type="hidden" value="3">
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>银行卡号</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="number" value="{:isset($info.cardno) ? $info.cardno : ''}" name="cardno" placeholder="银行卡号" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>所属银行</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<select class="uk-input" name="cardtype">
								<option value="">请选择</option>
								{volist name=":config('CARDTYPE')" id="v" key="k"}
									<option value="{$k}" {eq name="$info.cardtype" value="$k"} selected {/eq}>{$v}</option>
								{/volist}
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>开户姓名</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="text" value="{:isset($info.cardname) ? $info.cardname : ''}" name="cardname" placeholder="银行卡开户姓名" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>开户地址</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<select class="uk-input" name="province" onchange="get_city(this.value)">
								<option value="">请选择</option>
								{volist name=":get_model_func('City', 'list_datad', ['pid'=>1], 0, 0, 'id, title', 'id asc')" id="v"}
									<option value="{$v.id}" {eq name="$info.province" value="$v.id"} selected {/eq}>{$v.title}</option>
								{/volist}
							</select>
						</div>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<select class="uk-input" name="city" id="city">
							{eq name=":isset($info.city)" value="true"}
								{volist name=":get_model_func('City', 'list_datad', ['pid'=>$info.province], 0, 0, 'id, title', 'id asc')" id="v"}
									<option value="{$v.title}" 
									<option value="{$v.id}" {eq name="$info.city" value="$v.title"} selected {/eq}>{$v.title}</option>
								{/volist}
							{/eq}
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<!-- <div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>提现金额</span>
					</div> -->
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="text" value="{:isset($info.address) ? $info.address : ''}" name="address" placeholder="请填写详细的开户银行地址" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>提现金额</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="number" value="" name="totalprice" placeholder="请输入提现金额" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<!-- 	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>请输入密码</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="password" value="" name="" placeholder="请输入密码" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div> -->
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>手机号</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="number" name="phone" value="{$uinfo.phone}" id="phone" readonly />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>验证码</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="text" placeholder="请输入验证码" name="code"/>
						</div>
					</div>
					<div class="mui-table-cell uk-text-middle uk-width-em-8 mui-text-right">
						<a href="Javascript:" class="mui-btn mui-btn-primary mui-btn-small cocoSendSms">获取验证码</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	</form>
	<div class="tm-padded-medium">
		<div class="uk-text-center uk-text-small uk-text-muted-2 uk-margin-small-bottom">
			提现金额不能低于{:config('DEPOSIT_MINPRICE')}元，提现手续费为{:config('DEPOSIT_RATE')}%
		</div>
		<div>
			<button class="mui-btn mui-btn-warning mui-btn-medium uk-width-1-1 cocoPostFormAjax" type="button" ajaxurl="{:url('v1/order_amount/tixian')}" formid="formid" ajax-callback="suc_back">确认提现</button>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="{$statics}js/jquery.countdown.js"></script>
<script type="text/javascript">
	function suc_back (obj, data) {
		coco_alert('提交成功',function () {
			coco_close_window();
		});
	}
	function get_city (value) {
		var datajson = {};
		datajson.pid = value;
		$.ajax({
			url: '/v1/city/get_city',
			type:'post',
			dataType: 'json',
			data: datajson,
			beforeSend: function(request) {
				request.setRequestHeader("token", token);
				request.setRequestHeader("timestamp", timestamp);
			},
			error: function (XMLHttpRequest, textStatus, errorThrown) {
				coco_close_loading();
				var codetext = XMLHttpRequest.responseText;
				codejson = eval("(" + codetext + ")");
				coco_alert(codejson.msg);
				return false;
			},
			success:function(datajson){
				if (!datajson.response) {
			      return false;
			    };
			    var html = '';
			    $.each(datajson.response, function(index, item) {
			      html += '<option value="'+item.title+'">'+item.title+'</option>';
			    });
			    $('#city').html('');
			    $('#city').append(html);
			}
		})
	}
</script>
{/block}